let fs = require('fs');
module.exports = () => {
    return async (ctx,next) => {
        let startTime = new Date().getTime();
        await next();
        let endTime = new Date().getTime();
        let time = endTime - startTime;  //花费的时间 
        let method = ctx.request.method;
        let url = ctx.request.url;
        console.log(ctx.request);
        fs.appendFileSync('./log.log',`${url}-${method}-${time}`)
        
    }
}


